package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MdjfCasePersonMapper;
import com.ruoyi.system.domain.MdjfCasePerson;
import com.ruoyi.system.service.IMdjfCasePersonService;

/**
 * 部门办理相关人员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class MdjfCasePersonServiceImpl implements IMdjfCasePersonService 
{
    @Autowired
    private MdjfCasePersonMapper mdjfCasePersonMapper;

    /**
     * 查询部门办理相关人员
     * 
     * @param personId 部门办理相关人员主键
     * @return 部门办理相关人员
     */
    @Override
    public MdjfCasePerson selectMdjfCasePersonByPersonId(Long personId)
    {
        return mdjfCasePersonMapper.selectMdjfCasePersonByPersonId(personId);
    }

    /**
     * 查询部门办理相关人员列表
     * 
     * @param mdjfCasePerson 部门办理相关人员
     * @return 部门办理相关人员
     */
    @Override
    public List<MdjfCasePerson> selectMdjfCasePersonList(MdjfCasePerson mdjfCasePerson)
    {
        return mdjfCasePersonMapper.selectMdjfCasePersonList(mdjfCasePerson);
    }

    /**
     * 新增部门办理相关人员
     * 
     * @param mdjfCasePerson 部门办理相关人员
     * @return 结果
     */
    @Override
    public int insertMdjfCasePerson(MdjfCasePerson mdjfCasePerson)
    {
        mdjfCasePerson.setCreateTime(DateUtils.getNowDate());
        return mdjfCasePersonMapper.insertMdjfCasePerson(mdjfCasePerson);
    }

    /**
     * 修改部门办理相关人员
     * 
     * @param mdjfCasePerson 部门办理相关人员
     * @return 结果
     */
    @Override
    public int updateMdjfCasePerson(MdjfCasePerson mdjfCasePerson)
    {
        mdjfCasePerson.setUpdateTime(DateUtils.getNowDate());
        return mdjfCasePersonMapper.updateMdjfCasePerson(mdjfCasePerson);
    }

    /**
     * 批量删除部门办理相关人员
     * 
     * @param personIds 需要删除的部门办理相关人员主键
     * @return 结果
     */
    @Override
    public int deleteMdjfCasePersonByPersonIds(Long[] personIds)
    {
        return mdjfCasePersonMapper.deleteMdjfCasePersonByPersonIds(personIds);
    }

    /**
     * 删除部门办理相关人员信息
     * 
     * @param personId 部门办理相关人员主键
     * @return 结果
     */
    @Override
    public int deleteMdjfCasePersonByPersonId(Long personId)
    {
        return mdjfCasePersonMapper.deleteMdjfCasePersonByPersonId(personId);
    }

    @Override
    public int deleteMdjfCasePersonByCaseMainId(Long caseMainId) {

        return mdjfCasePersonMapper.deleteMdjfCasePersonByCaseMainId(caseMainId);
    }
}
